import Mock from 'mockjs'
import type { MockMethod } from 'vite-plugin-mock'

export default [
  // 获取顶层节点元素
  {
    url: '/api/auth/topnode',
    method: 'get',
    response: () => {
      return {
        code: 0,
        msg: 'ok',
        data: [
          {
            id: 1,
            name: '信息汇总'
          },
          {
            id: 2,
            name: '后台设置'
          },
          {
            id: 3,
            name: '电影管理'
          }
        ]
      }
    }
  },
  // 权限节点列表 -- 不分页
  {
    url: '/api/auth/list',
    method: 'get',
    response: () => {
      return {
        code: 0,
        msg: 'ok',
        data: [
          {
            id: 1,
            name: '信息汇总',
            ename: 'info',
            pid: 0,
            menu: 1,
            route: '',
            icon: 'PieChartOutlined',
            children: [
              {
                id: 10,
                name: '图形汇总',
                ename: 'dashoard',
                pid: 1,
                menu: 1,
                route: '/info/dashoard',
                icon: 'DesktopOutlined'
              }
            ]
          },
          {
            id: 2,
            name: '后台设置',
            ename: 'sys',
            pid: 0,
            menu: 1,
            route: '',
            icon: 'UserOutlined',
            children: [
              {
                id: 20,
                name: '用户列表',
                ename: 'user',
                pid: 2,
                menu: 1,
                route: '/sys/user',
                icon: 'TeamOutlined'
              },
              {
                id: 21,
                name: '地图',
                ename: 'role',
                pid: 2,
                menu: 1,
                route: '/sys/role',
                icon: 'FileOutlined'
              },
              {
                id: 22,
                name: '客服聊天',
                ename: 'role',
                pid: 2,
                menu: 1,
                route: '/sys/auths',
                icon: 'QqOutlined'
              }
            ]
          },
           {
            id: 3,
            name: '电影',
            ename: 'film',
            pid: 0,
            menu: 1,
            route: '',
            icon: 'CodeSandboxOutlined',
            children: [
              {
                id: 30,
                name: '电影列表',
                ename: 'filmlist',
                pid: 1,
                menu: 1,
                route: '/film/list',
                icon: 'AliyunOutlined'
              },
              {
                id: 31,
                name: '电影创建',
                ename: 'filmcreate',
                pid: 1,
                menu: 1,
                route: '/film/create',
                icon: 'DribbbleOutlined'
              }
            ]
          },
        ]
      }
    }
  }
] as MockMethod[]